#! /bin/sh
# Run CSHOT with CWP X Graphics

demo=8

x1beg=0 x1end=7500 x2beg=-100 x2end=32800

########################################################
cp -f param1_1 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par

xgraph <demo${demo}plot par=demo${demo}par style=seismic \
        -geometry 600x400+650+500 \
        title="Rays for demo$demo" \
        label1="Depth (ft)"  label2="Range (ft)" \
        x1beg=$x1beg x1end=$x1end x2beg=$x2beg x2end=$x2end &

cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 ftn=1 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=0 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data1.su
#######################################################

cp -f param1_2 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=2000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data2.su
#######################################################


cp -f param1_3 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=4000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data3.su
########################################################
cp -f param1_4 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=6000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data4.su
########################################################
cp -f param1_5 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=8000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data5.su
########################################################
cp -f param1_6 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=10000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data6.su
########################################################
cp -f param1_7 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=12000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data7.su
########################################################
cp -f param1_8 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=14000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data8.su
########################################################
cp -f param1_9 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=16000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data9.su
########################################################
cp -f param1_10 param1
cshot1 | cshotplot >demo${demo}plot  outpar=demo${demo}par
cshot2
suaddhead <demo${demo}traces ftn=1 ns=501 |
sushw key=dt a=4000 > data.su
sushw < data.su key=sx a=18000 c=100 j=100 | \
sushw key=offset a=0 b=100 j=100 > data10.su
########################################################
cat data1.su data2.su data3.su data4.su data5.su \
data6.su data7.su data8.su data9.su data10.su > data.su

suchw < data.su > data_tmp1.su key1=gx key2=sx key3=offset b=1 c=1 d=1
suchw < data_tmp1.su data.su key1=cdp key2=sx key3=gx b=1 c=1 d=2 | \
sugain agc=1 wagc=0.3 > data.su
rm -f data_tmp1.su
rm -f data1.su data2.su data3.su data4.su data5.su
rm -f data6.su data7.su data8.su data9.su data10.su

mv data.su ../
